import tensorflow as tf

"""
变量Variable类似程序中的变量,需要赋初始值
parameters: 2x3矩阵，标准差为2.0
其他随机数生成函数：
    random_uniform 均匀分布
    random_gamma Gamma均匀分布

weights = tf.Variable(tf.random_normal([2,3],stddev=2.0))
biases = tf.Variable(tf.zeros([3]))

w2 = tf.Variable(weights.initialized_value())
w3 = tf.Variable(weights.initialized_value()*2.0)
"""
w1 = tf.Variable(tf.random_normal([2,3],stddev=1.0,seed=1))
w2 = tf.Variable(tf.random_normal([3,1],stddev=1.0,seed=1))

x = tf.constant([[0.7,0.9]])

# 矩阵乘法
a = tf.matmul(x, w1)
y = tf.matmul(a, w2)

sess = tf.Session()

sess.run(w1.initializer)
sess.run(w2.initializer)
# 输出[[ 3.95757794]]
print(sess.run(y))
sess.close()